﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Senbo.Model.Entities
{
    public class Picture
    {
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        [Key]
        [Column(Order = 1)]
        [Required(ErrorMessage = "必须输入GUID")]
        public Guid Guid { get; set; }
        [Required(ErrorMessage = "必须输入图片地址")]
        [StringLength(200)]
        public string Src { get; set; }
        [Required(ErrorMessage = "必须输入添加时间")]
        public DateTime AddTime { get; set; }
        [Required(ErrorMessage = "请选择类型")]
        [ForeignKey("Category")]
        public Guid CategoryGuid { get; set; }
        public virtual Category Category { get; set; }
    }
}
